package org.xfy.ymcc.producer.impl;

import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.xfy.common.constant.RocketConstants;
import org.xfy.common.result.JsonResult;
import org.xfy.ymcc.producer.CourseProducer;
@Component
public class CourseProducerImpl implements CourseProducer {
    @Autowired
    private RocketMQTemplate template;
    @Override
    public JsonResult sendSMSProducer(String message) {
        template.sendOneWay(RocketConstants.COURSE_SEND_SMS_TOPIC+":"+RocketConstants.COURSE_SEND_SMS_TAG,message);
        return JsonResult.success();
    }

    @Override
    public JsonResult sendEmailProducer(String message) {
        template.sendOneWay(RocketConstants.COURSE_SEND_EMAIL_TOPIC+":"+RocketConstants.COURSE_SEND_EMAIL_TAG,message);
        return JsonResult.success();
    }
}
